<template>
    <div>
        <span v-show="num.c>0" @click="jian">-</span>
        <span v-show="num.c>0">{{num.c}}</span>
        <span @click="add">+</span>
    </div>
</template>
<script>
export default {
    props:["num","id"],
    methods:{
        add(){
            let num=this.num.c++;
            this.$bus.$emit('add',this.id,num)
        },
        jian(){
            let num=this.num.c--;
            this.$bus.$emit('add',this.id,num)
        }
    }
}
</script>
<style>


</style>

